import request from '@/utils/request'

// 查询字典列表
export function getDictionaryList(data) {
  return request({
    url: '/dictionary/list',
    method: 'post',
    data: data
  })
}

// 添加字典
export function add(data) {
  return request({
    url: '/dictionary/add',
    method: 'post',
    data: data
  })
}

// 列出组别
export function listGroup() {
  return request({
    url: '/dictionary/list/group',
    method: 'get'
  })
}

// 删除
export function deleteDictionary(id) {
  return request({
    url: '/dictionary/delete',
    method: 'post',
    data: {
      id
    }
  })
}

// 批量删除字典
export function batchRemoveRole(data) {
  return request({
    url: '/dictionary/delete',
    method: 'post',
    data: data
  })
}

// 更新
export function updateDictionary(data) {
  return request({
    url: '/dictionary/update',
    method: 'post',
    data: data
  })
}

// 搜索
export function searchDictionary(data) {
  return request({
    url: '/dictionary/search?value=' + data,
    method: 'get'
  })
}
